public class Op {
    static public void main(String [] args) {
        int a = 5, b = 10;

        // a + b       表达式
        int c = a + b;     //语句

        System.out.printf("a = %d, b = %d\n", a, b);
        System.out.printf("a + b = %d\n", a + b);
        System.out.printf("a - b = %d\n", a - b);
        System.out.printf("a * b = %d\n", a * b);
        System.out.printf("a / b = %.2f\n", ((float)a / b));
        System.out.printf("a %% b = %d\n", a % b);

        System.out.println("a > b = " + (a > b));
        System.out.println("a < b = " + (a < b));

        System.out.println("a > 10 && a < 20 = " + (a > 10 && a < 20));
        System.out.println("a > 10 || a < 20 = " + (a > 10 || a < 20));
        System.out.println("!(a > 10 || a < 20) = " + (!(a > 10 || a < 20)));

        c = a > 10 ? 100 : 999;
        /*
         * if (a > 10)
         *     c = 100;
         * else
         *     c = 999;
         */

        System.out.printf("c = %d\n", c);

        a = 100;
        System.out.printf("test a++ = %d\n", ++a);
        System.out.printf("a = %d\n", a);
    }
}
